#!/usr/local/bin/python
# Rob Dennis - Lurchington Q. Delacroix
# Keasby - TV renamer
# Project Homepage: http://code.google.com/p/keasby/

#--- Python Imports
import unittest
import logging
import abc

#--- Keasby Imports
from keasby_base import KeasbyError, KeasbyTestCase
from keasby_options import kopt

from keasby_toolbox import log

class KeasbySource(object):
    """
    Base source for use by KeasbyRepo
    """
    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def prime_search(self, tv_base):
        """
        Prime search for information/availability based on a given TvBase
        instance
        """
        return

    @abc.abstractmethod
    def __str__(self):
        """
        usable string representation
        """
        return self.__class__.__name__

class InfoSource(KeasbySource):
    """
    Source to get episode/series information from
    """

    @abc.abstractmethod
    def get_episode_title(self, tv_episode):
        """
        return the title of a given episode
        """


class AvailabilitySource(KeasbySource):
    """
    Source to check for availability
    """


class KeasbySourceInternalTestCase(KeasbyTestCase):
    """
    KeasbySource Test Case
    """
    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def test_prime_search(self):
        """
        test for prime_search
        """
        return

class InfoSourceInternalTestCase(KeasbySourceInternalTestCase):
    """
    KeasbySource Test Case
    """

    @abc.abstractmethod
    def test_get_episode_title(self):
        """
        test for get_episode_title
        """
        return


class AvailabilitySourceInternalTestCase(KeasbySourceInternalTestCase):
    """
    KeasbySource Test Case
    """

class KeasbySourceError(KeasbyError):
    """
    KeasbySource Exception
    """

class InfoSourceError(KeasbySourceError):
    """
    InfoSource Exception
    """

class AvailabilitySourceError(KeasbySourceError):
    """
    AvailabilitySource Exception
    """